package com.zigin.healthcard.controller;

import com.alibaba.fastjson.JSONObject;
import com.tencent.healthcard.impl.HealthCardServerImpl;
import com.tencent.healthcard.model.CommonIn;

import java.util.UUID;

public class TestApp {
    public static void  main(String[] args) {
        /**
         * 接口：调用获取接口调用凭证appToken接口
         */
        //appSecret
        String appSecret="0626b6e57b68a2c65643a4ba4e0xxxxx";
        HealthCardServerImpl healthCard=new HealthCardServerImpl(appSecret);
        //构造公共输入参数commonIn
        String appToken="";
        String requestId= UUID.randomUUID().toString().replaceAll("-", "").toUpperCase();
        String hospitalId="20012";
        int channelNum=0;
        CommonIn commonIn=new CommonIn(appToken,requestId,hospitalId,channelNum);
        //构造请求参数req
        String appId="e8e8974e9831185acf2fcec1e15xxxxx";
        //调用接口
        JSONObject appTokenObj=healthCard.getAppToken(commonIn,appId);
        //打印响应
        System.out.println("appToken:"+appTokenObj.toJSONString());

    }
}
